<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:forgeview="http://jboss.org/forge/view"	
	template="/resources/templates/pageTemplate.xhtml">

	<f:metadata>
		<f:viewParam name="id" value="#{sysUserLoginBean.id}"/>
		<f:event type="preRenderView" listener="#{sysUserLoginBean.retrieve}"/>
	</f:metadata>

	<ui:param name="pageTitle" value="Create Sys User Login"/>

	<ui:define name="header">
		Sys User Login
	</ui:define>

	<ui:define name="subheader">
		<c:choose>
			<c:when test="#{!empty sysUserLoginBean.id}">
				Edit existing Sys User Login
			</c:when>
			<c:otherwise>
				Create a new Sys User Login
			</c:otherwise>
		</c:choose>
	</ui:define>

	<ui:define name="footer"/>

	<ui:define name="main">
		<h:form id="create">
			<h:messages globalOnly="true" styleClass="error"/>

			<h:panelGrid columnClasses="label,component,required" columns="3">
				<h:outputLabel for="sysUserLoginBeanSysUserLoginSysOrg" value="Sys Org:"/>
				<h:panelGroup>
					<h:selectOneMenu converter="#{sysOrgBean.converter}" id="sysUserLoginBeanSysUserLoginSysOrg" value="#{sysUserLoginBean.sysUserLogin.sysOrg}">
						<f:selectItem/>
						<f:selectItems itemLabel="#{forgeview:display(_item)}" itemValue="#{_item}" value="#{sysOrgBean.all}" var="_item"/>
					</h:selectOneMenu>
					<h:message for="sysUserLoginBeanSysUserLoginSysOrg" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sysUserLoginBeanSysUserLoginHrEmp" value="Hr Emp:"/>
				<h:panelGroup>
					<h:selectOneMenu converter="#{hrEmpBean.converter}" id="sysUserLoginBeanSysUserLoginHrEmp" value="#{sysUserLoginBean.sysUserLogin.hrEmp}">
						<f:selectItem/>
						<f:selectItems itemLabel="#{forgeview:display(_item)}" itemValue="#{_item}" value="#{hrEmpBean.all}" var="_item"/>
					</h:selectOneMenu>
					<h:message for="sysUserLoginBeanSysUserLoginHrEmp" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sysUserLoginBeanSysUserLoginSysUserRole" value="Sys User Role:"/>
				<h:panelGroup>
					<h:selectOneMenu converter="#{sysUserRoleBean.converter}" id="sysUserLoginBeanSysUserLoginSysUserRole" value="#{sysUserLoginBean.sysUserLogin.sysUserRole}">
						<f:selectItem/>
						<f:selectItems itemLabel="#{forgeview:display(_item)}" itemValue="#{_item}" value="#{sysUserRoleBean.all}" var="_item"/>
					</h:selectOneMenu>
					<h:message for="sysUserLoginBeanSysUserLoginSysUserRole" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sysUserLoginBeanSysUserLoginUserName" value="User Name:"/>
				<h:panelGroup>
					<h:inputText id="sysUserLoginBeanSysUserLoginUserName" maxLength="50" value="#{sysUserLoginBean.sysUserLogin.userName}"/>
					<h:message for="sysUserLoginBeanSysUserLoginUserName" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sysUserLoginBeanSysUserLoginUserPassword" value="User Password:"/>
				<h:panelGroup>
					<h:inputText id="sysUserLoginBeanSysUserLoginUserPassword" maxLength="50" value="#{sysUserLoginBean.sysUserLogin.userPassword}"/>
					<h:message for="sysUserLoginBeanSysUserLoginUserPassword" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sysUserLoginBeanSysUserLoginUserDescr" value="User Descr:"/>
				<h:panelGroup>
					<h:inputText id="sysUserLoginBeanSysUserLoginUserDescr" maxLength="100" value="#{sysUserLoginBean.sysUserLogin.userDescr}"/>
					<h:message for="sysUserLoginBeanSysUserLoginUserDescr" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sysUserLoginBeanSysUserLoginCuser" value="Cuser:"/>
				<h:panelGroup>
					<h:inputText id="sysUserLoginBeanSysUserLoginCuser" maxLength="50" value="#{sysUserLoginBean.sysUserLogin.cuser}"/>
					<h:message for="sysUserLoginBeanSysUserLoginCuser" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sysUserLoginBeanSysUserLoginSysUserRoles" value="Sys User Roles:"/>
				<h:panelGroup>
					<ui:param name="_collection" value="#{sysUserLoginBean.sysUserLogin.sysUserRoles}"/>
					<h:dataTable id="sysUserLoginBeanSysUserLoginSysUserRoles" styleClass="data-table" value="#{forgeview:asList(_collection)}" var="_item">
						<h:column>
							<f:facet name="header">
								<h:outputText value="Role Name"/>
							</f:facet>
							<h:link outcome="/form/sysUserRole/view">
								<f:param name="id" value="#{_item.roleNo}"/>
								<h:outputText id="itemRoleName" value="#{_item.roleName}"/>
							</h:link>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Role Descr"/>
							</f:facet>
							<h:link outcome="/form/sysUserRole/view">
								<f:param name="id" value="#{_item.roleNo}"/>
								<h:outputText id="itemRoleDescr" value="#{_item.roleDescr}"/>
							</h:link>
						</h:column>
						<h:column footerClass="remove-column" headerClass="remove-column">
							<h:commandLink action="#{_collection.remove(_item)}" styleClass="remove-button"/>
						</h:column>
					</h:dataTable>
					<h:panelGrid columnClasses=",remove-column" columns="2" styleClass="data-table-footer">
						<h:selectOneMenu converter="#{sysUserRoleBean.converter}" id="sysUserLoginBeanSysUserLoginSysUserRolesSelect" value="#{requestScope['sysUserLoginBeanSysUserLoginSysUserRolesSelect']}">
							<f:selectItem/>
							<f:selectItems itemLabel="#{forgeview:display(_item)}" itemValue="#{_item}" value="#{sysUserRoleBean.all}" var="_item"/>
						</h:selectOneMenu>
						<h:commandLink action="#{_collection.add(requestScope['sysUserLoginBeanSysUserLoginSysUserRolesSelect'])}" id="sysUserLoginBeanSysUserLoginSysUserRolesAdd" onclick="if (document.getElementById(document.forms[0].id+':sysUserLoginBeanSysUserLoginSysUserRolesSelect').selectedIndex &lt; 1) { alert('Must select a Sys User Role'); return false; }" styleClass="add-button"/>
					</h:panelGrid>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sysUserLoginBeanSysUserLoginSysOrgs" value="Sys Orgs:"/>
				<h:panelGroup>
					<ui:param name="_collection" value="#{sysUserLoginBean.sysUserLogin.sysOrgs}"/>
					<h:dataTable id="sysUserLoginBeanSysUserLoginSysOrgs" styleClass="data-table" value="#{forgeview:asList(_collection)}" var="_item">
						<h:column>
							<f:facet name="header">
								<h:outputText value="Org Type No"/>
							</f:facet>
							<h:link outcome="/form/sysOrg/view">
								<f:param name="id" value="#{_item.orgNo}"/>
								<h:outputText id="itemOrgTypeNo" value="#{_item.orgTypeNo}"/>
							</h:link>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Org Code"/>
							</f:facet>
							<h:link outcome="/form/sysOrg/view">
								<f:param name="id" value="#{_item.orgNo}"/>
								<h:outputText id="itemOrgCode" value="#{_item.orgCode}"/>
							</h:link>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Org Name"/>
							</f:facet>
							<h:link outcome="/form/sysOrg/view">
								<f:param name="id" value="#{_item.orgNo}"/>
								<h:outputText id="itemOrgName" value="#{_item.orgName}"/>
							</h:link>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Base Org No"/>
							</f:facet>
							<h:link outcome="/form/sysOrg/view">
								<f:param name="id" value="#{_item.orgNo}"/>
								<h:outputText id="itemBaseOrgNo" value="#{_item.baseOrgNo}"/>
							</h:link>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Addr No"/>
							</f:facet>
							<h:link outcome="/form/sysOrg/view">
								<f:param name="id" value="#{_item.orgNo}"/>
								<h:outputText id="itemAddrNo" value="#{_item.addrNo}"/>
							</h:link>
						</h:column>
						<h:column footerClass="remove-column" headerClass="remove-column">
							<h:commandLink action="#{_collection.remove(_item)}" styleClass="remove-button"/>
						</h:column>
					</h:dataTable>
					<h:panelGrid columnClasses=",remove-column" columns="2" styleClass="data-table-footer">
						<h:selectOneMenu converter="#{sysOrgBean.converter}" id="sysUserLoginBeanSysUserLoginSysOrgsSelect" value="#{requestScope['sysUserLoginBeanSysUserLoginSysOrgsSelect']}">
							<f:selectItem/>
							<f:selectItems itemLabel="#{forgeview:display(_item)}" itemValue="#{_item}" value="#{sysOrgBean.all}" var="_item"/>
						</h:selectOneMenu>
						<h:commandLink action="#{_collection.add(requestScope['sysUserLoginBeanSysUserLoginSysOrgsSelect'])}" id="sysUserLoginBeanSysUserLoginSysOrgsAdd" onclick="if (document.getElementById(document.forms[0].id+':sysUserLoginBeanSysUserLoginSysOrgsSelect').selectedIndex &lt; 1) { alert('Must select a Sys Org'); return false; }" styleClass="add-button"/>
					</h:panelGrid>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sysUserLoginBeanSysUserLoginSysUserAppCompPrivileges" value="Sys User App Comp Privileges:"/>
				<h:panelGroup>
					<ui:param name="_collection" value="#{sysUserLoginBean.sysUserLogin.sysUserAppCompPrivileges}"/>
					<h:dataTable id="sysUserLoginBeanSysUserLoginSysUserAppCompPrivileges" styleClass="data-table" value="#{forgeview:asList(_collection)}" var="_item">
						<h:column>
							<f:facet name="header">
								<h:outputText value="Sys App Comp"/>
							</f:facet>
							<h:link outcome="/form/sysUserAppCompPrivilege/view">
								<f:param name="id" value="#{_item.id}"/>
								<h:outputText id="forgeviewdisplayitemSysAppComp" value="#{forgeview:display(_item.sysAppComp)}"/>
							</h:link>
							<f:facet name="footer">
								<h:selectOneMenu converter="#{sysAppCompBean.converter}" id="sysUserAppCompPrivilegeBeanAddSysAppComp" value="#{sysUserAppCompPrivilegeBean.add.sysAppComp}">
									<f:selectItem/>
									<f:selectItems itemLabel="#{forgeview:display(_item)}" itemValue="#{_item}" value="#{sysAppCompBean.all}" var="_item"/>
								</h:selectOneMenu>
								<h:message for="sysUserAppCompPrivilegeBeanAddSysAppComp" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Allow View"/>
							</f:facet>
							<h:link outcome="/form/sysUserAppCompPrivilege/view">
								<f:param name="id" value="#{_item.id}"/>
								<h:outputText id="itemAllowView" value="#{_item.allowView}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="sysUserAppCompPrivilegeBeanAddAllowView" value="#{sysUserAppCompPrivilegeBean.add.allowView}"/>
								<h:message for="sysUserAppCompPrivilegeBeanAddAllowView" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Allow Edit"/>
							</f:facet>
							<h:link outcome="/form/sysUserAppCompPrivilege/view">
								<f:param name="id" value="#{_item.id}"/>
								<h:outputText id="itemAllowEdit" value="#{_item.allowEdit}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="sysUserAppCompPrivilegeBeanAddAllowEdit" value="#{sysUserAppCompPrivilegeBean.add.allowEdit}"/>
								<h:message for="sysUserAppCompPrivilegeBeanAddAllowEdit" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Allow Add"/>
							</f:facet>
							<h:link outcome="/form/sysUserAppCompPrivilege/view">
								<f:param name="id" value="#{_item.id}"/>
								<h:outputText id="itemAllowAdd" value="#{_item.allowAdd}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="sysUserAppCompPrivilegeBeanAddAllowAdd" value="#{sysUserAppCompPrivilegeBean.add.allowAdd}"/>
								<h:message for="sysUserAppCompPrivilegeBeanAddAllowAdd" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Allow Delete"/>
							</f:facet>
							<h:link outcome="/form/sysUserAppCompPrivilege/view">
								<f:param name="id" value="#{_item.id}"/>
								<h:outputText id="itemAllowDelete" value="#{_item.allowDelete}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="sysUserAppCompPrivilegeBeanAddAllowDelete" value="#{sysUserAppCompPrivilegeBean.add.allowDelete}"/>
								<h:message for="sysUserAppCompPrivilegeBeanAddAllowDelete" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column footerClass="remove-column" headerClass="remove-column">
							<h:commandLink action="#{_collection.remove(_item)}" styleClass="remove-button"/>
							<f:facet name="footer">
								<h:commandLink action="#{_collection.add(sysUserAppCompPrivilegeBean.added)}" id="sysUserLoginBeanSysUserLoginSysUserAppCompPrivilegesAdd" styleClass="add-button">
									<f:setPropertyActionListener target="#{sysUserAppCompPrivilegeBean.add.sysUserLogin}" value="#{sysUserLoginBean.sysUserLogin}"/>
								</h:commandLink>
							</f:facet>
						</h:column>
					</h:dataTable>
				</h:panelGroup>
				<h:outputText/>
			</h:panelGrid>

			<div class="buttons">
				<h:commandLink value="Save" action="#{sysUserLoginBean.update}" styleClass="btn btn-primary"/>
				<c:choose>
					<c:when test="#{!empty sysUserLoginBean.id}">
						<h:link value="Cancel" outcome="view" styleClass="btn btn-primary">
							<f:param name="id" value="#{sysUserLoginBean.id}"/>
						</h:link>
						<h:commandLink value="Delete" action="#{sysUserLoginBean.delete}" styleClass="btn btn-primary"/>
					</c:when>
					<c:otherwise>
						<h:link value="Cancel" outcome="search" styleClass="btn btn-primary"/>
					</c:otherwise>
				</c:choose>
			</div>
		</h:form>
	</ui:define>

</ui:composition>